<!--
	巡视登记编辑
-->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>JZ-energy</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../css/mui.min.css"/>
		<link rel="stylesheet" type="text/css" href="../css/public.css"/>
		<link rel="stylesheet" type="text/css" href="../css/icons-extra.css" />
		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
		<style type="text/css">
			.mui-input-group .mui-input-row { height: 50px;}
			.mui-input-row label {padding: 16px 15px;}
			input[type=text] {height: 50px;}
			input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color: #BDBDBD;}
		</style>
	</head>
	<body>
		<!--底部导航栏-->
		<nav class="mui-bar mui-bar-tab bg-FFF">
			<a class="mui-tab-item" href="index.html">
				<span class="mui-icon"><img src="../img/index.png"/></span>
				<span class="mui-tab-label">首页</span>
			</a>
			<a class="mui-tab-item" href="monitor.html">
				<span class="mui-icon"><img src="../img/jiance.png"/></span>
				<span class="mui-tab-label">监测</span>
			</a>
			<a class="mui-tab-item" href="work.html">
				<span class="mui-icon"><img src="../img/gongzuo.png"/></span>
				<span class="mui-tab-label">工作</span>
			</a>
			<a class="mui-tab-item" href="myInfor.html">
				<span class="mui-icon"><img src="../img/wode.png"/></span>
				<span class="mui-tab-label">我的</span>
			</a>
		</nav>
		<!--头部导航栏-->
		<header class="mui-bar mui-bar-nav bg-FFF header-bom">
			<a href="" class="mui-action-back mui-icon-extra mui-icon-extra-arrowleftcricle mui-pull-left col-fonts"></a>
			<h1 class="mui-title col-fonts">巡视登记</h1>
		</header>
		<div class="mui-content bg-F8F font-15">
			<form class="mui-input-group af-he be-he">
				<input type="hidden" name="userid" id="userid" value=""/>
				<input type="hidden" name="id" id="id">
				<div class="mui-input-row col-fonts af-he line2">
					<label for="">巡视地点</label>
					<input type="text" value="" placeholder="请填写文字" name="place" id="place"  class="font-15 ells" maxlength="99"/>
				</div>
				<div class="mui-input-row af-he line2">
					<div class="mui-navigate-right col-fonts">
						<label for="">开始时间</label>
						<input type="text" data-options='{"type":"datetime"}' name="stime" id="stime" value="2017-10-8 00:00" readonly="readonly" class="beggingTime font-15"/>
					</div>
				</div>
				<div class="mui-input-row col-fonts af-he line2">
					<div class="mui-navigate-right col-fonts">
						<label for="">结束时间</label>
						<input type="text" name="etime" data-options='{"type":"datetime"}' id="etime" value="" readonly="readonly" class="endingTime font-15"/>
					</div>
				</div>
				<div class="mui-input-row col-fonts af-he line2">
					<label for="">巡视人员</label>
					<input type="text" value="" placeholder="请填写文字" name="peoples" id="peoples" class="font-15" maxlength="200"/>
				</div>
				<div class="mui-input-row col-fonts af-he line2" style="height: auto;">
					<label for="">巡视内容</label>
					<textarea class="font-15" name="content" id="content" rows="" cols="" placeholder="请填写文字" maxlength="99" style="min-height: 80px;"></textarea>
				</div>
				<div class="mui-input-row col-fonts af-he line2">
					<label for="">巡视结果</label>
					<div class="mui-pull-right wrapbox" id="tourstate">
						<span class="update-btn font-13 rightSplit on-active" data-value="0">未完成</span>
						<span class="update-btn font-13 rightSplit" data-value="1">正常</span>
						<span class="update-btn font-13" data-value="2">有异常</span>
					</div>
				</div>
				<div class="mui-input-row col-fonts af-he line2" style="height: auto;">
					<label for="">异常结果</label>
					<textarea name="comstate" id="comstate" rows="3" cols="" class="font-15" maxlength="500" placeholder="请填写文字"></textarea>
				</div>
				<div class="mui-input-row col-fonts af-he line2" style="height: auto;">
					<label for="">备注</label>
					<textarea name="remark" id="remark" rows="3" cols="" class="font-15" maxlength="500" placeholder="请填写文字"></textarea>
				</div>
			</form>
			<div class="mui-content-padded submitBtn">
				<button type="button" class="mui-btn mui-btn-block submit-btn col-FFF font-15" onclick="savepatrol()">保存</button>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../js/jquery.min.js"></script>
	<script src="../js/mui.min.js"></script>
	<script type="text/javascript" src="../js/main.js"></script>
	<script src="../js/mui.picker.min.js"></script>
	<script src="../js/resultSelect.js"></script>
	<script src="../js/defect/patrolEdit.js"></script>
	<script>
	initItem();
	mui.init({
		beforeback: function() {
			try{
				var  detailPage = plus.webview.getWebviewById('patrolDJ');
				mui.fire(detailPage,'refresh',param);
			}catch(e){}
		}
	});
	function initItem(){
		//时间设定
			var date = new Date();
			var year = date.getFullYear();
			
		(function($) {
			//开始时间和结束时间设置
			var Boptions = {
				type: "datetime", 
    			beginDate: new Date(2000,0,1),
    			endDate: new Date(),
			};
			var Eoptions = {
				type: "datetime",
    			beginDate: new Date(),
    			endDate: year,
			};
//			$("#etime").val(date.format("yyyy-MM-dd hh:mm"));
			$('.beggingTime').off("tap");
			$('.beggingTime').on('tap', function() {
				$(this).focus();
				var picker = new mui.DtPicker(Boptions);
				picker.show(function(rs) {
					$('.beggingTime')[0].value=rs.text;
					picker.dispose();
				});
			});
			$('.endingTime').off("tap");
			$('.endingTime').on('tap', function() {
				$(this).focus();
				var picker = new mui.DtPicker(Eoptions);
				picker.show(function(rs) {
					$('.endingTime')[0].value=rs.text;
					picker.dispose();
				});
			});
		})($);
		$("#stime").val(date.format("yyyy-MM-dd hh:mm"));
		$("nav a").removeClass("mui-active");
		$("nav a").find("img").each(function(){
			var newsrc = $(this).attr("src").replace("-hover","");
			$(this).attr("src",newsrc);
		});
		 $("nav a").find("img[src*='"+param.sel+"']").attr("src","../img/"+param.sel+"-hover.png");
        $("nav a").find("img[src*='"+param.sel+"']").closest("a").addClass("mui-active");
	}
	</script>
</html>
